package com.csliubo.eclipse.plugin.sqlgenerator.core.model;

import java.util.List;

public class Table {

    private String    name;
    private List<Row> rows;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<Row> getRows() {
        return rows;
    }

    public void setRows(List<Row> rows) {
        this.rows = rows;
    }

    public Table(String name, List<Row> rows) {
        this.name = name;
        this.rows = rows;
    }

    public Table(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(name + "\n");
        for (Row row : rows) {
            sb.append(row.toString()).append("\n");
        }
        return sb.toString();
    }
}
